<template>
    <view class="pub_page pub_page_bg pub_businessSchool pub_header_padding pub_tabbar_padding">
        <pub-head :headerConfig="headerConfig"></pub-head>
        <pub-tabbar :active="2"></pub-tabbar>
        <div class="pub_page_scroll page_box">
            <!-- <div class="pub_banner" v-if="bannerList.length">
                <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="5000"
                    v-cloak:indicator-dots="false">
                    <swiper-item v-for="(item, key) in bannerList" :key="key">
                        <view class="swiper_item" :style="{ backgroundImage: 'url(' + item + ')' }">
                            <div class="play_icon" v-if="$comFun.isVideoUrl(item)">
                                <text class="icon icon-font-basic icon-b-arrow-4-1"></text>
                            </div>
                        </view>
                    </swiper-item>
                </swiper>
            </div> -->
            <div class="video_div" v-if="videoSrc"
                :style="{backgroundImage:'url('+`${videoSrc}?x-oss-process=video/snapshot,t_0,f_jpg`+')'}">
                <div class="play_icon">
                    <text class="icon icon-font-basic icon-b-arrow-4-1"></text>
                </div>
                <div class="video_mask" @click="jumpPage({url:'/pages/other/video',data:{videoUrl:videoSrc}})"></div>
            </div>
            <!-- <div class="nums_div">
                <div class="title">利商银龄生态可持续发展奖金</div>
                <div class="price">
                    <div class="box">
                        <span class="num" :class="[`num_${li.type}`]" v-for="(li,key) in priceShow" :key="key">{{
                            li.value }}</span>
                    </div>
                </div>
                <div class="msg">本奖金作为银龄生态、就业、公益、助农等发放，本奖金由第三方以及各个利商议事团监管</div>
                <div class="link">
                    <span @click="jumpPage({url:'/pages/other/document',data:{id:'1925176727897022465'}})">《奖金说明》</span>
                    <span @click="jumpPage({url:'/pages/other/document',data:{id:'1925178021055553538'}})">《贡献说明》</span>
                </div>
            </div> -->
            <div class="tabs_div">
                <div class="lis">
                    <div class="li" v-for="(li,key) in tabsList" :key="key"
                        @click="jumpPage({url:'/pages/other/document',data:{id:li.id}})">
                        <pub-image class="img" :src="li.img"></pub-image>
                        <div class="txt">{{ li.txt }}</div>
                    </div>
                </div>
            </div>
            <div class="text_div">
                <div class="lis">
                    <div class="li" v-for="(li,key) in textsList" :key="key"
                        @click="jumpPage({url:'/pages/other/document',data:{id:li.noticeId}})">
                        <div class="txt">{{ li.noticeTitle }}</div>
                        <text class="icon icon-font-basic icon-b-arrow-1-2"></text>
                    </div>
                </div>
            </div>
        </div>
    </view>
</template>

<script>

export default {
    data() {
        return {
            headerConfig: {
                title: '商学院',//标题栏内容
                header_color: 'rgba(0,0,0,0)'
            },

            bannerList: ['../../static/common/headimg.png', '../../static/common/headimg.png'],

            videoSrc: '',
            // price: '000071.97',
            tabsList: [{
                txt: '拼团玩法攻略',
                img: '../../static/bimg/img_31.png',
                id: '1928424754129829890'
            }, {
                txt: '“消费尽孝”玩法',
                img: '../../static/bimg/img_32.png',
                id: '1928425305676611586'
            }, {
                txt: '银龄团长介绍',
                img: '../../static/bimg/img_33.png',
                id: '1928425657410945026'
            }, {
                txt: '抵用券用途介绍',
                img: '../../static/bimg/img_34.png',
                id: '1928425818413498369'
            }],
            textsList: [],
            userData: '',//用户金额数据
        };
    },
    computed: {
        priceShow() {
            let price = (this.userData?.developmentFund || 0).toFixed(2).toString()
            // let price = ((123456.9).toFixed(2)).toString()
            while (price.length < 9) {
                price = '0' + price;
            }
            const arr = price.split("")
            return arr.map((item) => {
                let type = 'txt'
                if (item == ".") type = 'dot'
                return {
                    type,
                    value: item
                }
            })
        }
    },
    mounted() {
        this.getBusinessSchoolDocList()
        // this.getUserData()
        this.getVideoInfo()
    },
    methods: {
        async getBusinessSchoolDocList() {
            this.$comFun.openLoading();
            const res = await this.$request.get('public/getBusinessSchoolDocList', {
                pageNo: 1,
                pageSize: 50,
            });
            this.$comFun.closeLoading();
            if (res.code == 200) {
                this.textsList = res?.result?.records || [];
            }
        },
        async getUserData() {
            const res = await this.$request.get('user/getPersonData');
            // console.log(res);
            if (res.code == 200) {
                this.userData = res.result;
            }
        },
        async getVideoInfo() {
            let configRes = await getApp().getConfigList();
            this.videoSrc = configRes?.collegeUrl || '';
        }
    },
};
</script>

<style lang="scss" scoped>
@import "@/common/css/businessSchool.scss";
</style>
